from scipy.integrate import quad

# 定义被积函数
def integrand(x):
    return x**2

# 计算积分
result, error = quad(integrand, 0, 1)
print("Integral result:", result)
print("Error estimate:", error)